<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var username = ["iwen","ime","sakura","frank"];
        //循环 ->遍历
        //length:数组长度
        console.log(username.length);
        for(var i = 0;i < username.length;i++){
            console.log(username[i]);
        }
        var i = 0;
        while(i < username.length){
            console.log(username[i]);
            i++; 
        }

        for(var i in username){
            console.log(username[i]);
            
        }
    </script>
</body>
</html>